
#import <Foundation/Foundation.h>

typedef NS_ENUM(NSUInteger, LanB_Associate) {
    LanB_Associate_Assign,
    LanB_Associate_RetainNonatomic,
    LanB_Associate_CopyNonatomic,
    LanB_Associate_Retain,
    LanB_Associate_Copy,
    LanB_Associate_Weak,
};

NS_ASSUME_NONNULL_BEGIN

@interface NSObject (LanBAssociate)

/**
 关联 obj for key
*/
- (void)lanB_associateWithKey:(const void *)key obj:(id)obj policy:(LanB_Associate)policy;

/**
 获取 关联 obj for key
*/
- (nullable id)lanB_associateForKey:(const void *)key;

/**
 通过 字符串 关联 obj
 */
- (void (^)(NSString * key, id obj, LanB_Associate policy))lanB_associate_bind;

/**
 通过 字符串 获取 关联 obj
*/
- (id (^)(NSString * key))lanB_associate_value;

/**
 清除所有关联
 */
- (void)lanB_associate_removeAll;


@end

NS_ASSUME_NONNULL_END

